import React from 'react'
import { Route, IndexRoute } from 'react-router'
import Repo from '../components/repo'
export default {
    path: '/repos',
    getComponent : function(location, callback){
        require.ensure([], function (require) {//参数1：依赖 参数2：回调   参数3：chunkName
            callback(null, require('../components/repos').default)
        })
    },
    getChildRoutes(location, callback) {
        console.log('按需加载子路由...')
        require.ensure([], function (require) {
            callback(null, [
                {
                    path: 'repo(/:username)', component: Repo
                }
            ])
        })
    }
}